package com.yunhe.authority.service.authority.impl;

import com.yunhe.authority.domain.authority.Station;
import com.yunhe.authority.repository.authority.StationRepository;
import com.yunhe.authority.repository.authority.impl.StationDao;
import com.yunhe.authority.service.authority.StationForTransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhengbo
 * @date 2021/11/22 16:53
 */
@Service
public class StationForTransferServiceImpl implements StationForTransferService {

    @Autowired
    private StationRepository stationRepository;

    @Autowired
    private StationDao stationDao;

    @Override
    public Station findById(Long id) {
        return null;
    }

    @Override
    public Station findByCode(Long code) {
        return null;
    }

    @Override
    public List<Station> getStations(Long userId) {
        List<Station> stationList;
        if (userId != null) {
            stationList = (List<Station>)stationRepository.findStationByUserId(userId);
        } else {
            stationList = (List<Station>)stationRepository.findAll();
        }
        return stationList;
    }
}
